package com.sun.entitys;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.EntityListeners;
import jakarta.persistence.Id;
import jakarta.persistence.MappedSuperclass;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * MP自动填充Handler
 *
 * @Author sun
 * @CreateTime 2025/9/6 18:53
 */
@Data
@MappedSuperclass
@EntityListeners(CreateAndUpadteEvent.class)
public class BaseEntity {
    @Id
    @Schema(name = "主键")
    private Long id;
    @Schema(name = "名称")
    private String name;
    @Schema(name = "编码")
    private String code;
    @Schema(name = "备注")
    private String remark;
    @Schema(name = "描述")
    private String description;
    @Column(columnDefinition = "int default 0")
    @Schema(name = "排序")
    private int orderNumber;
    @Schema(name = "创建时间")
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
    private Long createrId;
    private Long updaterId;
    private String createrName;
    private String updaterName;
    @Column(columnDefinition = "bigint default 0")
    private Long deleted;
    @Column(columnDefinition = "boolean default true")
    private boolean enabled;
}
